<template>
  <div>
    <div class="Content-title">热销推荐</div>
    <ul>
      <router-link tag="li"
                   class="item border-bottom"
                   v-for="item of content"
                   :key="item.id"
                   :to="'/detail/' + item.id">
        <img class="item-img"
             :src="item.imgUrl"
             alt="" />
        <div class="item-info">
          <p class="info-title">{{item.title}}</p>
          <p class="info-desc">{{item.desc}}</p>
          <button class="info-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeContent',
  props: {
    content: Array
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/mixins.styl'
.Content-title
  margin-top: 0.2rem
  line-height: 0.6rem
  background: #eee
  text-indent: 0.2rem
  text-align: center
  box-sizing: border-box
  font-weight: 450
  letter-spacing: 0.15rem
.item
  overflow: hidden
  display: flex
  height: 1.9rem
  .item-img
    width: 1.7rem
    height: 1.7rem
    padding: 0.1rem
  .item-info
    flex: 1
    padding: 0.1rem
    min-width: 0
    .info-title
      line-height: 0.54rem
      font-size: 0.32rem
      ellipsis()
    .info-desc
      margin-top: 0.05rem
      line-height: 0.4rem
      color: #ccc
      ellipsis()
    .info-button
      line-height: 0.4rem
      margin-top: 0.2rem
      margin-left: 0.1rem
      background: #ff9300
      paddimg: 0 0.2rem
      border-radius: 0.06rem
      color: #fff
</style>
